/*
 *  txdnet.cn tonydon
 * 
 */
package cn.txdnet.txcms.domain;

import cn.txdnet.txweb.annotation.validation.Default;
import cn.txdnet.txweb.annotation.validation.NotEmpty;
import cn.txdnet.txweb.annotation.validation.Validator;

/**
 *
 * @author txdnet
 */
public class Infotags extends BaseEntity{
    private static final long serialVersionUID = -1429772069894579711L;
    
    @NotEmpty
    private Long infoid;
    
    @Default
    private Integer tagid;
    
    public Infotags(Long infoid, Integer tagid){
        this.infoid = infoid;
        this.tagid = tagid;
    }

    @Override
    public boolean validate() {
       return Validator.validate(this);
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 41 * hash + (this.infoid != null ? this.infoid.hashCode() : 0);
        hash = 41 * hash + (this.tagid != null ? this.tagid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Infotags other = (Infotags) obj;
        if (this.infoid != other.infoid && (this.infoid == null || !this.infoid.equals(other.infoid))) {
            return false;
        }
        if (this.tagid != other.tagid && (this.tagid == null || !this.tagid.equals(other.tagid))) {
            return false;
        }
        return true;
    }

    /**
     * @return the infoid
     */
    public Long getInfoid() {
        return infoid;
    }

    /**
     * @param infoid the infoid to set
     */
    public void setInfoid(Long infoid) {
        this.infoid = infoid;
    }

    /**
     * @return the tagid
     */
    public Integer getTagid() {
        return tagid;
    }

    /**
     * @param tagid the tagid to set
     */
    public void setTagid(Integer tagid) {
        this.tagid = tagid;
    }
    
}
